<template>
	<view class="gui-padding">

		<u-parse v-if="html != null" :content="html" @preview="preview" @navigate="navigate"></u-parse>

		<view class="" v-if="type == 'email'">
			柳州博亚科技有限公司邮箱：boyaltd@boyaltd.cn
		</view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				url: "https://app.lgwisdomunion/app.html#/agreement?header=true",
				html: null,
				type: null
			}
		},
		onLoad(e) {
			console.log('e: ', e);
			this.type = e.type
			uni.showLoading({
				title: '加载中'
			});
			if (e.type == 'email') {
				uni.setNavigationBarTitle({
					title: '联系我们'
				})
				this.html = '<img src="../../../static/boyaEwm.png" mode="">'
				uni.hideLoading();
			} else {
				this.agreements(e.type);
			}
		},
		methods: {
			agreements(n) {
				let self = this;

				this.$boya.NGet('/agreements/' + n, {}, function(res) {

					let html = res.data.content.split("##qingwuit##");

					self.html = html[0];

					uni.hideLoading();

					// self.article=parserHtml.parserHTML(res.data.content);
					// self.article.map(function(item,index){
					console.log('html: ', html);
					// })
					uni.setNavigationBarTitle({
						title: res.data.name
					})
				}, null, {
					CheckToken: false
				});
			}
		}
	}
</script>

<style>
</style>